package com.youdianda.controller.user;

import com.youdianda.dto.UserLoginDTO;
import com.youdianda.result.Result;
import com.youdianda.service.IYddUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户登录
 */

@RestController
@RequestMapping("/home/index")
public class UserLoginController {


    @Autowired
    private IYddUserService userService;

    /**
     * 登录
     * @param loginDTO
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestBody UserLoginDTO loginDTO) {
        return userService.login(loginDTO);
    }
}
